package com.example.bzh.gamecat.ui.live.hot;

import android.util.Log;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.bzh.gamecat.R;
import com.example.bzh.gamecat.bean.hot.RecommendMasterListBean;
import com.example.bzh.gamecat.util.RoundImageUtil;

import java.util.List;

/**
 * Created by peter on 2016/8/18.
 */
public class HotRecycleviewAdapter extends BaseQuickAdapter<RecommendMasterListBean> {

    public HotRecycleviewAdapter(int layoutResId, List<RecommendMasterListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, RecommendMasterListBean recommendMasterListBean) {
        baseViewHolder.setText(R.id.tv_nickname_hot, recommendMasterListBean.getNickName());
        baseViewHolder.setText(R.id.tv_name_hot, recommendMasterListBean.getName());
        Log.i(TAG, "recommendMasterListBean: "+recommendMasterListBean.getName());
        baseViewHolder.setText(R.id.tv_usercount_hot, String.valueOf(recommendMasterListBean.getUserCount()) + "人在看");
        ImageView ivcover = (ImageView) baseViewHolder.itemView.findViewById(R.id.iv_icon_hot);
        RoundImageUtil.getRoundImage(baseViewHolder.itemView.getContext(), recommendMasterListBean.getCover(), ivcover);
        ImageView ivicon = (ImageView) baseViewHolder.itemView.findViewById(R.id.iv_cover_hot);
        Glide.with(baseViewHolder.itemView.getContext()).load(recommendMasterListBean.getIcon()).into(ivicon);
    }
}
